﻿<form class="form-search">
  Search: <input type="text" class="input-medium search-query" ng-model="query">
</form>
<table class="table table-striped table-hover">
<tr>
    <th><a href="" ng-click="predicate = 'Name'; reverse=false">Name</a>
        (<a href ng-click="predicate = '-Name'; reverse=false">^</a>)</th>
    <th><a href="" ng-click="predicate = 'Price'; reverse=!reverse">Price</a></th>
    <th><a href="" ng-click="predicate = 'Quantity'; reverse=!reverse">Quantity</a></th>
    <th><a href="" ng-click="predicate = 'Category'; reverse=!reverse">Category</a></th>
    <th><a href="" ng-click="predicate = 'Morgue.Name'; reverse=!reverse">Morgue</a></th>
    <th>&nbsp;</th>
</tr>
<tr ng-repeat="part in autoparts | filter:query | orderBy:predicate:reverse">
    <td>{{part.Name}}</td>
    <td>{{part.Price}} лева</td>
    <td>{{part.Quantity}}</td>
    <td><a href="#/autoparts/categories/{{part.Category}}">{{part.Category}}</a></td>
    <td>{{part.MorgueName}}</td>
    <td><a href="#/autoparts/edit/{{part.Id}}" class="btn" ng-click="editPartById()">Edit</a></td>
</tr>
</table>